import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { equipmentTypeModelParamVO, equipmentTypeModelParamForm, equipmentTypeModelParamQuery } from '@/api/facility/equipment-type-model-param/types';

/**
 * 查询设备类型-模型-参数列表
 * @param query
 * @returns {*}
 */

export const listequipmentTypeModelParam = (query?: equipmentTypeModelParamQuery): AxiosPromise<equipmentTypeModelParamVO[]> => {
  return request({
    url: '/equipment/equipment-type-model-param/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询设备类型-模型-参数详细
 * @param equipmentTypeAttributeId
 */
export const getequipmentTypeModelParam = (equipmentTypeAttributeId: string | number): AxiosPromise<equipmentTypeModelParamVO> => {
  return request({
    url: '/equipment/equipment-type-model-param/' + equipmentTypeAttributeId,
    method: 'get'
  });
};

/**
 * 新增设备类型-模型-参数
 * @param data
 */
export const addequipmentTypeModelParam = (data: equipmentTypeModelParamForm) => {
  return request({
    url: '/equipment/equipment-type-model-param',
    method: 'post',
    data: data
  });
};

/**
 * 修改设备类型-模型-参数
 * @param data
 */
export const updateequipmentTypeModelParam = (data: equipmentTypeModelParamForm) => {
  return request({
    url: '/equipment/equipment-type-model-param',
    method: 'put',
    data: data
  });
};

/**
 * 删除设备类型-模型-参数
 * @param equipmentTypeAttributeId
 */
export const delequipmentTypeModelParam = (equipmentTypeAttributeId: string | number | Array<string | number>) => {
  return request({
    url: '/equipment/equipment-type-model-param/' + equipmentTypeAttributeId,
    method: 'delete'
  });
};
